package berlinatyourfingertips.ua.apis;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Scanner;

/**
 * Static! Fire a string and get a result ;)
 * 
 * @author Denny Koch
 *
 */
public class UAHttp {

	public static String get(String url) {
		String result = "";
		
		InputStream is = null;	
		
		try {
			URL urlO = new URL(url); 
			is = urlO.openStream(); 
			result = new Scanner( is ).useDelimiter( "\\Z" ).next(); 
		} catch ( Exception e ) { 
			e.printStackTrace();
		} finally {
			if (is != null) 
				try { is.close(); } catch ( IOException e ) { } 
		} 		
		
		return result;
	}
	
}
